Skip to content

enhancement(metrics): support for metrics v3 protocol#1175

Draft
tobz wants to merge 2 commits into
mainfrom
tobz/datadog-metrics-v3-payload-support
Draft

enhancement(metrics): support for metrics v3 protocol#1175
tobz wants to merge 2 commits into
mainfrom
tobz/datadog-metrics-v3-payload-support

Conversation

@tobz

@tobz tobz commented Feb 6, 2026

Copy link
Copy Markdown
Member

Summary

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

How did you test this PR?

References

@dd-octo-sts dd-octo-sts Bot added area/core Core functionality, event model, etc. area/components Sources, transforms, and destinations. encoder/datadog-metrics Datadog Metrics encoder. forwarder/datadog Datadog forwarder. labels Feb 6, 2026

tobz commented Feb 6, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@tobz tobz changed the title claude-generated v3 implementation enhancement(datadog encoder): support for metrics v3 protocol Feb 6, 2026
@pr-commenter

pr-commenter Bot commented Feb 6, 2026

Copy link
Copy Markdown

Binary Size Analysis (Agent Data Plane)

Baseline: 08cd4c4 · Comparison: 53976e1 · diff
Analysis Configuration: stripped binaries · Pass/Fail Threshold: +5%
Sizes: 37.93 MiB (baseline) vs 38.12 MiB (comparison)
Size Change: +197.84 KiB (+0.51%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
core +90.08 KiB 14334
saluki_components::encoders::datadog +76.38 KiB 373
figment +63.89 KiB 673
otlp_protos::otlp_include::opentelemetry -59.37 KiB 209
saluki_components::config_registry::datadog -57.32 KiB 68
prost +38.44 KiB 572
anyhow +36.55 KiB 1706
axum -26.33 KiB 504
http_body_util -18.65 KiB 191
tonic +18.02 KiB 474
serde_core +15.35 KiB 929
hashbrown +14.78 KiB 1112
[sections] +13.58 KiB 9
saluki_components::forwarders::datadog +12.85 KiB 22
rustls -12.72 KiB 163
&mut serde_json -12.10 KiB 99
serde_json +8.90 KiB 304
saluki_core::data_model::event +7.94 KiB 118
serde -7.74 KiB 119
saluki_core::topology::interconnect -7.35 KiB 76
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW]  +151Ki  [NEW]  +151Ki    agent_data_plane::cli::run::handle_run_command::_{{closure}}::hdf43122119cb417f
  +0.5%  +121Ki  +0.4% +76.6Ki    [47902 Others]
  [NEW] +84.7Ki  [NEW] +84.5Ki    agent_data_plane::cli::dogstatsd::handle_dogstatsd_command::_{{closure}}::h04cdcf5f98317be5
  [NEW] +67.4Ki  [NEW] +67.3Ki    agent_data_plane::cli::run::create_topology::_{{closure}}::hdd0ec93af12084ef
  [NEW] +66.7Ki  [NEW] +66.5Ki    saluki_core::topology::built::BuiltTopology::spawn::_{{closure}}::h5f0395680bdd9ebd
  [NEW] +58.3Ki  [NEW] +58.1Ki    agent_data_plane::cli::debug::handle_debug_command::_{{closure}}::hbacedc5f90e31de8
  [NEW] +57.9Ki  [NEW] +57.7Ki    saluki_core::topology::blueprint::TopologyBlueprint::build::_{{closure}}::hfd190c8aff62510c
  [NEW] +56.8Ki  [NEW] +56.7Ki    core::ops::function::FnOnce::call_once::h85b8424640380127
  [NEW] +45.4Ki  [NEW] +45.3Ki    saluki_components::sources::otlp::metrics::translator::OtlpMetricsTranslator::translate_metrics::h8012780bb139686e
  [NEW] +41.1Ki  [NEW] +40.9Ki    saluki_components::common::datadog::io::run_endpoint_io_loop::_{{closure}}::h3a46bad6c2ce93e7
  [NEW] +38.3Ki  [NEW] +38.1Ki    agent_data_plane::internal::env::workload::build_collector::_{{closure}}::h52ba18eaf2437ae0
  [NEW] +38.0Ki  [NEW] +37.8Ki    _<saluki_components::forwarders::otlp::OtlpForwarder as saluki_core::components::forwarders::Forwarder>::run::_{{closure}}::h016bf3839cdd664e
  [DEL] -42.8Ki  [DEL] -42.6Ki    saluki_components::common::datadog::io::run_endpoint_io_loop::_{{closure}}::h01bb1ce7d2bee930
  [DEL] -46.6Ki  [DEL] -46.5Ki    saluki_components::sources::otlp::metrics::translator::OtlpMetricsTranslator::translate_metrics::h24d23376b04440eb
  [DEL] -55.3Ki  [DEL] -55.2Ki    saluki_components::config_registry::datadog::SUPPORTED_ANNOTATIONS::_{{closure}}::h80552fc4b6f8591d
  [DEL] -57.3Ki  [DEL] -57.1Ki    agent_data_plane::cli::debug::handle_debug_command::_{{closure}}::h62090eaa45b10b54
  [DEL] -57.9Ki  [DEL] -57.8Ki    saluki_core::topology::blueprint::TopologyBlueprint::build::_{{closure}}::h10b60228b955c2dd
  [DEL] -65.4Ki  [DEL] -65.3Ki    saluki_core::topology::built::BuiltTopology::spawn::_{{closure}}::h5b418dd5fcc8e912
  [DEL] -68.0Ki  [DEL] -67.9Ki    agent_data_plane::cli::run::create_topology::_{{closure}}::h3212bb8ddcd8b298
  [DEL] -84.1Ki  [DEL] -83.9Ki    agent_data_plane::cli::dogstatsd::handle_dogstatsd_command::_{{closure}}::hf1b9b95c6e5e7eda
  [DEL]  -153Ki  [DEL]  -152Ki    agent_data_plane::cli::run::handle_run_command::_{{closure}}::hdf07f62ba689f516
  +0.5%  +197Ki  +0.5%  +152Ki    TOTAL

@pr-commenter

pr-commenter Bot commented Feb 6, 2026

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Run ID: d450b2b6-e633-430b-977e-62e8af0fb7a3
Baseline: 08cd4c40 · Comparison: 53976e19 · diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment (35)

Experiments configured erratic: true are tagged (ignored) and skipped when determining which experiments regressed or improved. Experiments which are detected as erratic at runtime are tagged (erratic) to flag that the run's sample dispersion was high, but their regression / improvement signal still counts.

experiment goal Δ mean % links
otlp_ingest_metrics_5mb_memory memory ⚪ +3.53 metrics profiles logs
dsd_uds_512kb_3k_contexts_cpu (erratic) cpu ⚪ +2.12 metrics profiles logs
dsd_uds_10mb_3k_contexts_cpu (erratic) cpu ⚪ +1.87 metrics profiles logs
dsd_uds_100mb_3k_contexts_cpu (erratic) cpu ⚪ +1.40 metrics profiles logs
otlp_ingest_metrics_5mb_cpu (erratic) cpu ⚪ +1.23 metrics profiles logs
quality_gates_rss_idle memory ⚪ +0.93 metrics profiles logs
quality_gates_rss_dsd_heavy memory ⚪ +0.71 metrics profiles logs
dsd_uds_1mb_3k_contexts_memory memory ⚪ +0.66 metrics profiles logs
otlp_ingest_traces_ottl_filtering_5mb_memory memory ⚪ +0.50 metrics profiles logs
dsd_uds_500mb_3k_contexts_cpu (erratic) cpu ⚪ +0.37 metrics profiles logs
quality_gates_rss_dsd_medium memory ⚪ +0.26 metrics profiles logs
otlp_ingest_traces_5mb_throughput throughput ⚪ -0.16 metrics profiles logs
otlp_ingest_traces_5mb_memory memory ⚪ +0.13 metrics profiles logs
quality_gates_rss_dsd_low memory ⚪ +0.09 metrics profiles logs
otlp_ingest_traces_ottl_transform_5mb_memory memory ⚪ +0.08 metrics profiles logs
dsd_uds_10mb_3k_contexts_throughput throughput ⚪ -0.01 metrics profiles logs
otlp_ingest_traces_ottl_filtering_5mb_throughput throughput ⚪ -0.01 metrics profiles logs
dsd_uds_512kb_3k_contexts_throughput throughput ⚪ +0.00 metrics profiles logs
otlp_ingest_logs_5mb_throughput (ignored) throughput ⚪ +0.00 metrics profiles logs
dsd_uds_1mb_3k_contexts_throughput throughput ⚪ +0.00 metrics profiles logs
dsd_uds_100mb_3k_contexts_throughput throughput ⚪ +0.01 metrics profiles logs
otlp_ingest_logs_5mb_cpu (ignored) cpu ⚪ -0.01 metrics profiles logs
otlp_ingest_metrics_5mb_throughput throughput ⚪ +0.02 metrics profiles logs
dsd_uds_500mb_3k_contexts_memory memory ⚪ -0.10 metrics profiles logs
dsd_uds_10mb_3k_contexts_memory memory ⚪ -0.14 metrics profiles logs
dsd_uds_100mb_3k_contexts_memory memory ⚪ -0.16 metrics profiles logs
dsd_uds_500mb_3k_contexts_throughput throughput ⚪ +0.20 metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory ⚪ -0.33 metrics profiles logs
otlp_ingest_traces_ottl_transform_5mb_throughput throughput ⚪ +0.37 metrics profiles logs
otlp_ingest_traces_5mb_cpu (erratic) cpu ⚪ -0.41 metrics profiles logs
dsd_uds_512kb_3k_contexts_memory memory ⚪ -0.46 metrics profiles logs
otlp_ingest_traces_ottl_transform_5mb_cpu (erratic) cpu ⚪ -1.25 metrics profiles logs
otlp_ingest_logs_5mb_memory (ignored) memory ⚪ -2.36 metrics profiles logs
otlp_ingest_traces_ottl_filtering_5mb_cpu (erratic) cpu ⚪ -2.51 metrics profiles logs
dsd_uds_1mb_3k_contexts_cpu (erratic) cpu 🟢 -17.71 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 126 MiB ≤ 140 MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 40.1 MiB ≤ 50 MiB metrics profiles logs
quality_gates_rss_dsd_medium memory_usage 10/10 ✅ 60.9 MiB ≤ 75 MiB metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 ✅ 184 MiB ≤ 200 MiB metrics profiles logs
quality_gates_rss_idle memory_usage 10/10 ✅ 26.8 MiB ≤ 40 MiB metrics profiles logs
Explanation

A change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression (is_regression: true). Improvements use the matching criteria for the improving direction. Experiments configured erratic: true (tagged (ignored)) are skipped outright; experiments detected as erratic at runtime (tagged (erratic)) still count, since that flag describes sample dispersion rather than directional certainty. The Δ mean % cell is colored accordingly: 🟢 = improvement, 🔴 = regression, ⚪ = neutral. Reduction in CPU or memory is an improvement; reduction in ingress throughput is a regression.

@tobz

tobz commented Feb 11, 2026

Copy link
Copy Markdown
Member Author

This is temporarily blocked on there being a version of the Datadog Agent for us to test against in correctness tests that has up-to-date v3 metrics support.

Currently, we're hitting an issue related to rate intervals being delta encoded when they shouldn't be. That bug is fixed in DataDog/datadog-agent#45825 but won't be released until 7.77: roughly 2 weeks from now before an RC is available to use. We can potentially do a hacky image build or something for keep going in the meantime and then switch back to a proper Agent version once available, we'll see.

@tobz tobz force-pushed the tobz/datadog-metrics-v3-payload-support branch from 79cdda1 to 59636cd Compare February 12, 2026 18:34
@dd-octo-sts dd-octo-sts Bot added area/io General I/O and networking. area/ci CI/CD, automated testing, etc. area/test All things testing: unit/integration, correctness, SMP regression, etc. labels Feb 12, 2026
@tobz

tobz commented Feb 13, 2026

Copy link
Copy Markdown
Member Author

We've temporarily handled the issue of correctness tests by using a "dev" container image (datadoghq/agent-dev) based on the latest fix for V3 support in the Datadog Agent. With this in place, we're now currently passing for both dsd-plain (V2 payloads) and dsd-plain-v3 (new, V3 payloads only).

We can't merge this as-is: we need to wait for at least an RC build of Datadog Agent 7.77 so we can pin to a non-development image. In the meantime, I'm going to work on making sure we've integrated all of the same small fixes/changes that have been steadily being made upstream in the Datadog Agent repository for V3 support.

@tobz tobz force-pushed the tobz/datadog-metrics-v3-payload-support branch from 30ee642 to 898021d Compare February 25, 2026 13:23
@tobz tobz force-pushed the tobz/datadog-metrics-v3-payload-support branch from be9a81c to a9f5109 Compare March 9, 2026 13:28
@tobz tobz force-pushed the tobz/datadog-metrics-v3-payload-support branch from a9f5109 to 31b5f82 Compare March 30, 2026 17:50
Comment thread lib/saluki-components/src/encoders/datadog/metrics/v3/writer.rs Outdated
Comment thread lib/saluki-components/src/encoders/datadog/metrics/v3/writer.rs Outdated
Comment thread bin/correctness/ground-truth/src/analysis/metrics/types.rs Outdated
});
let v3_flushed = if let Some(v3_metrics) = maybe_v3_metrics {
if v2_flushed || v3_metrics.len() >= v3_endpoint_config.max_metrics_per_payload() {
encode_and_flush_v3_metrics(endpoint, &v3_endpoint_config, v3_metrics, &telemetry, &mut payloads_tx, batch_id.as_ref(), v3_payload_info).await?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to observe any intake payload size limits, or am I missing anything?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct.

Right now, we're either flushing with the V2 encoder determines it needs to flush (so that we generate an equivalent payload in terms of the contained metrics between the two) or if we exceed the configured maximum metrics per payload limit.

In V2/V3 mode, I suppose it's entirely possible to have the V3 payload exceed the payload limits, although it would be incredibly unlikely. In V3 only mode, it's obviously a much more likely risk.

My thought process was that we would improve this -- make V3 encoding aware of the payload limits -- at the same time we added incremental compression to match the behavior of the Agent... since back when this was originally written many weeks ago, it seemed like we'd have enough time between then and "V3 only in production / for customers" to do the follow-up work.

I guess the question I have is: do you feel like we still have that sort of time before we want to be running V3 only?

Ok(encoded) => {
match create_v3_request("/api/intake/metrics/v3/series", encoded, ep_config.compression_scheme()).await {
Ok(request) => {
flush_payload(request, events, payloads_tx, batch_id, 0, 1, payload_info).await?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional that batch_seq and batch_len are hard-coded as 0 and 1?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is intentional, but only in the context of us not currently splitting V3 payloads: there can literally only ever be a single V3 payload in each batch.

(Mostly related to the question you left about not obeying intake payload size limits.)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't sound right: there can be multiple v2 payloads constructed from even a single event buffer, so even if they mach one to one, there should be multiple v3 ones. Or are we using word batch differently here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's probably some missing context/mismatched terminology here, yeah.

Every time we receive an "event buffer", we process all of the metrics in the event buffer, incrementally encoding them via the request builder. As we're doing that, we might reach the point where a payload is "full" (aka adding another metric would cause the final payload to exceed the (un)compressed size limits) and we have to flush it before encoding the next metric in the event buffer. That scenario is what I'm referring to here.

Unlike the Core Agent, we don't immediately emit partial payloads for the remainder of an event buffer: if we finish processing an event buffer, and there's still remaining metrics in the request builder, we wait for a period of time for additional event buffers to come in and eventually time out and flush that partial payload.

@tobz tobz force-pushed the tobz/datadog-metrics-v3-payload-support branch from ca5ebc6 to 16afa2e Compare April 9, 2026 19:44
Comment thread lib/saluki-components/src/encoders/datadog/metrics/mod.rs Outdated
Comment thread lib/saluki-components/src/encoders/datadog/metrics/mod.rs Outdated
@dd-octo-sts dd-octo-sts Bot removed the area/ci CI/CD, automated testing, etc. label May 19, 2026
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented May 19, 2026

Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 2 Pipeline jobs failed

DataDog/saluki | check-protos   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). Protocol Buffers definitions not up-to-date. Please run the appropriate command to update and commit the changes.

DataDog/saluki | test-integration-macos-arm64   View in Datadog   GitLab

🔄 Retry job. This looks flaky and may succeed on retry. 18 failed tests due to unexpected process exits, indicating instability during test execution.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 53976e1 | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts dd-octo-sts Bot added the area/ci CI/CD, automated testing, etc. label May 27, 2026
@rayz rayz changed the title enhancement(datadog encoder): support for metrics v3 protocol enhancement(metrics): support for metrics v3 protocol May 27, 2026
@tobz tobz force-pushed the tobz/datadog-metrics-v3-payload-support branch from f27ed86 to f4967da Compare June 1, 2026 19:04
@dd-octo-sts dd-octo-sts Bot added area/docs Reference documentation. and removed area/ci CI/CD, automated testing, etc. forwarder/datadog Datadog forwarder. labels Jun 1, 2026
@tobz tobz force-pushed the tobz/datadog-metrics-v3-payload-support branch from f4967da to d804b60 Compare June 1, 2026 19:49
@dd-octo-sts dd-octo-sts Bot removed the area/docs Reference documentation. label Jun 1, 2026
Adds experimental V3 columnar encoding for series and sketch metrics behind the serializer_experimental_use_v3_api.* config keys, including a V2/V3 validation mode, V3 intake routing/filtering, intake-side V3 payload parsing for correctness testing, and the dsd-plain-v3 correctness cases. Existing V1/V2 series and sketch encoding is preserved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tobz tobz force-pushed the tobz/datadog-metrics-v3-payload-support branch from 348f227 to d203dbf Compare June 1, 2026 20:48
@dd-octo-sts dd-octo-sts Bot added the area/docs Reference documentation. label Jun 1, 2026
## Summary
<!-- Please provide a brief summary about what this PR does.
This should help the reviewers give feedback faster and with higher
quality. -->

Adds V3 series shadow sampling support to ADP, matching the Core Agent
config/defaults for:

  - `serializer_experimental_use_v3_api.series.shadow_sample_rate`
  - `serializer_experimental_use_v3_api.series.shadow_sites`
  - `serializer_experimental_use_v3_api.series.beta_route`

When series V3 is not authoritative, ADP can now sample V2 series
flushes and send a correlated V3 beta shadow payload with the same
metrics validation batch headers. Shadowing is limited to V2 series
baselines, matching the Core Agent behavior.

Also fixes the V3 correctness harness so the new `dsd-plain-v3` cases
decode and compare V3 payloads correctly. Fake intake now handles V3
metric routes, and `stele` normalizes V3 columnar payloads, including
host resources and Agent-compatible sketch summary ordering.



Todo / Follow Up: Shadow sampling is currently encoder-scoped in ADP. A
follow-up should make it endpoint/resolver-scoped like the Core Agent
for mixed endpoint and multi-site configurations.


## Change Type
- [ ] Bug fix
- [x] New feature
- [ ] Non-functional (chore, refactoring, docs)
- [ ] Performance


## How did you test this PR?
<!-- Please how you tested these changes here -->
Unit Tests / CI
## References

<!-- Please list any issues closed by this PR. -->

<!--
- Closes: <issue link>
-->

<!-- Any other issues or PRs relevant to this PR? Feel free to list them
here. -->
@dd-octo-sts dd-octo-sts Bot added the forwarder/datadog Datadog forwarder. label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/components Sources, transforms, and destinations. area/core Core functionality, event model, etc. area/docs Reference documentation. area/io General I/O and networking. area/test All things testing: unit/integration, correctness, SMP regression, etc. encoder/datadog-metrics Datadog Metrics encoder. forwarder/datadog Datadog forwarder.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants